
package com.cainli.image;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;

import org.apache.http.Header;
import org.apache.http.client.CookieStore;

public class LocaleFileDownloader implements ProtocolDownloader
{

    @Override
    public File downloadImage(URL url, OutputStream out, Header[] headers, CookieStore cookies) throws IOException
    {
        File f = new File(url.getFile());
        if(f.exists())
        {
            return f;
        }
        else
        {
            throw new IOException("File not Found. url: " + url);
        }
    }

    @Override
    public boolean useDiskCache()
    {
        return false;
    }

    @Override
    public Object decodeFile(File f)
    {
        return null;
    }

    @Override
    public boolean isDirty(URL url, long cacheTime)
    {
        return false;
    }

    @Override
    public boolean onPreDownload(URLDrawable drawable)
    {
        return false;
    }
}
